package com.xinqi.modules.prepare.prepare.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.annotations.Describe;
import com.xinqi.common.base.enums.BaseEnum;
import lombok.Getter;

/**
 * 备课区类型
 * <p>
 * 备课区类型，1:互动课件；2:资料；3:作业；4:测评；5:讨论；6:互动视频；8:公告；99:题库；10:成员
 * </p>
 *
 * @author linkai
 * @date 2023/03/19
 */
@Describe("备课区类型")
public enum PrepareTypeEnum implements BaseEnum {

    INTERACT_COURSEWARE("1", "互动课件"),
    DATA("2", "资料"),
    HOMEWORK("3", "作业"),
    PAPER("4", "测评"),
    DISCUSS("5", "讨论"),
    INTERACT_VIDEO("6", "互动视频"),
    NOTICE("8", "公告"),
    QUESTION_BANK("99", "题库"),
    MEMBER("10", "成员"),
    FOLDER("40", "文件夹"),
    LOG("41", "日志"),
    ;

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    PrepareTypeEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static PrepareTypeEnum of(String code) {
        return BaseEnum.of(PrepareTypeEnum.class, code);
    }

}
